home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_01_07 / 1n07019a < prev    next >
Text File  |  1990-11-03  |  5KB  |  111 lines

  1.  
  2. typedef struct vga_info_block { /* VESA SuperVGA Subfunction 00h    */
  3.    char VESASignature[4];       /* "VESA" signature, NOT terminated */
  4.    short VESAVersion;           /* VESA version number              */
  5.    char far *OEMStringPtr;      /* Points to OEM signature string   */
  6.    long capabilities;           /* Capabilities (reserved)          */
  7.    short far *VideoModePtr;     /* VESA modes supported, zero-term. */
  8.    short TotalMemory;           /* Number of 64K blocks, v1.1 ONLY! */
  9.    char Reserved[236];          /* Reserved area, do not use!       */
  10.    } VgaInfoBlock;
  11.  
  12. typedef struct mode_info_block { /* VESA SuperVGA Subfunction 01h   */
  13.    short ModeAttributes;         /* flags                           */
  14.    char WinAAttributes;          /* Window "A" attributes           */
  15.    char WinBAttributes;          /* Window "B" attributes           */
  16.    short WinGranularity;         /* Window granularity in Kb        */
  17.    short WinSize;                /* Window size in Kb               */
  18.    unsigned short WinASegment;   /* Segment normally at A000h       */
  19.    unsigned short WinBSegment;   /* Segment normally at A000h       */
  20.    void (far *WinFuncPtr) ();    /* shortcut call to Subfunction 05h*/
  21.    short BytesPerScanLine;       /* Bytes per scan line             */
  22.  
  23.    /* Optional info present only if bit 1 of ModeAttributes is set: */
  24.    short XResolution;            /* Horizontal resolution           */
  25.    short YResolution;            /* Vertical resolution             */
  26.    char XCharSize;               /* Character cell width            */
  27.    char YCharSize;               /* Character cell height           */
  28.    char NumberOfPlanes;          /* Number of memory planes         */
  29.    char BitsPerPixel;            /* Bits per pixel                  */
  30.    char NumberOfBanks;           /* Number of banks (CGA/Herc)      */
  31.    char MemoryModel;             /* Memory model type               */
  32.    char BankSize;                /* Bank size in Kb                 */
  33.    char NumberOfImagePages;      /* Display page count, v1.1 ONLY!  */
  34.    char CurrentImagePage;        /* Current Image page, v1.1 ONLY!  */
  35.    char Reserved[225];           /* Reserved area, do not use!      */
  36.    } ModeInfoBlock;
  37.  
  38. #define VIDEO_INT         0x10  /* General video services INT       */
  39. #define SVGA_SUPPORT      0x4F  /* SuperVGA functions for INT 10h   */
  40. #define VESA_SIGNATURE   "VESA"
  41. #define SVGA_INFO_BLOCK   256   /* Returned by subfunction 00h      */
  42.  
  43. #define VESA_VER_100     0x100  /* Minimum VESA version available   */
  44. #define VESA_VER_110     0x110  /* Required for some fields         */
  45.  
  46. /* SuperVGA subfunctions (AL=??) */
  47.  
  48. #define SVGA_INFO         0x00  /* Return SuperVGA Information      */
  49. #define SVGA_MODE_INFO    0x01  /* Return SuperVGA Mode Information */
  50. #define SVGA_SET_MODE     0x02  /* Set SuperVGA Mode                */
  51. #define SVGA_GET_MODE     0x03  /* Get SuperVGA Mode                */
  52. #define SVGA_SAVE_RESTORE 0x04  /* Save or Restore SVGA Mode        */
  53. #define SVGA_CPU_VID_WIN  0x05  /* Set SuperVGA CPU Video Mem Win   */
  54. #define SVGA_LOG_LINE_LEN 0x06  /* Set SuperVGA CPU Video Mem Win   */
  55. #define SVGA_DISP_START   0x07  /* Set SuperVGA CPU Video Mem Win   */
  56.  
  57.  
  58. /* Flags returned in ModeAttributes, subfunction 00h */
  59.  
  60. #define SVGA_MODE_HARDWARE  0x01  /* Mode supported by this monitor?*/
  61. #define SVGA_MODE_EXTENDED  0x02  /* Is extend information present? */
  62. #define SVGA_MODE_BIOS      0x04  /* BIOS support for this mode?    */
  63. #define SVGA_MODE_COLOR     0x08  /* Is this a color/mono mode?     */
  64. #define SVGA_MODE_GRAPHICS  0x10  /* Is this a graphics/text mode?  */
  65.  
  66. /* Flags returned in Win?Attributes, subfunction 00h */
  67.  
  68. #define SVGA_WIN_SUPPORTED  0x01  /* Is window supported in mode?   */
  69. #define SVGA_WIN_READABLE   0x02  /* Is window readable in mode?    */
  70. #define SVGA_WIN_WRITEABLE  0x04  /* Is window writeable in mode?   */
  71.  
  72. /* Flag used by SetSVGAMode, subfunction 02h */
  73.  
  74. #define DONT_CLEAR_MEMORY_FLAG   0x8000 /* High bit of BX */
  75. #define CLEAR_MEMORY_FLAG        0x0000 /* High bit of BX */
  76.  
  77. /* Flags used by SaveSVGAMode and RestoreSVGAMode, subfunction 04h */
  78.  
  79. #define SVGA_VIDEO_STATE_HARD     0x01 /* as used in CX register */
  80. #define SVGA_VIDEO_STATE_BIOS     0x02
  81. #define SVGA_VIDEO_STATE_DAC      0x04
  82. #define SVGA_VIDEO_STATE_SVGA     0x08
  83. #define SVGA_VIDEO_STATE_ALL      0x0F
  84.  
  85. #define SVGA_SR_GET_BUFFER_SIZE      0x00 /* as used in DL register */
  86. #define SVGA_SR_SAVE_VIDEO_STATE     0x01
  87. #define SVGA_SR_RESTORE_VIDEO_STATE  0x02
  88.  
  89. /* Flags used by SelectSVGAMemoryWindow, and GetSVGAMemory Window,
  90.    subfunction 05h */
  91.  
  92. /* Window numbers */
  93. #define WINDOW_A    0x00
  94. #define WINDOW_B    0x01
  95.  
  96. /* Sub-subfunction numbers */
  97. #define SVGA_VID_WIN_SELECT 0x00  /* as used in BH register */
  98. #define SVGA_VID_WIN_GET    0x01
  99.  
  100. #define SVGA_LOG_LINE_SELECT 0x00 /* as used in BL register */
  101. #define SVGA_LOG_LINE_GET    0x00
  102.  
  103. #define SVGA_DISP_START_SET 0x00  /* as used in BL register */
  104. #define SVGA_DISP_START_GET 0x00
  105.  
  106. /* Error returns from C interface routines */
  107.  
  108. #define VESA_OK                    0x004F /* Function executed normally */
  109. #define ERROR_VESA_NOT_SUPPORTED  -1  /* Not supported by driver    */
  110. #define ERROR_VESA_NO_SIGNATURE   -2  /* Signature string mismatch  */
  111.